package demo1;

/*class Base{
    public int a;
    public int b;
}
class Derived extends Base {
    public int c;
    public void method (){
        a = 1;
        b = 2;
        c = 3;
    }
}*/
/*class Base{
    public int a = 9;
    public int b = 99;
}
class Derived extends Base {
    public int a = 88;

    public void method() {
        System.out.println("a: " + a);
        System.out.println("b: " + b);
    }

}*/
class Base{
    int a = 99;
    public void method() {
        System.out.println("B::method()");
    }
}
class Derived extends Base {
    int a = 199;
    public void method2() {
        System.out.println("Derived::method()");
    }
    public void method() {
        System.out.println("B::method()");
    }
    public void test() {
        super.method();
        method2();
        System.out.println(a);
        System.out.println(this.a);
        System.out.println(super.a);
    }

}
class Test2{
    public static void main(String[] args) {
        Derived derived  = new Derived();
        derived.test();
    }
}